home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / midipk.exe / KNOB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-05-11  |  21.2 KB  |  645 lines

  1. VERSION 4.00
  2. Begin VB.Form FormKnob 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Knob Properties Example"
  5.    ClientHeight    =   4080
  6.    ClientLeft      =   1500
  7.    ClientTop       =   4065
  8.    ClientWidth     =   8445
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   4485
  20.    Left            =   1440
  21.    LinkTopic       =   "Form1"
  22.    MaxButton       =   0   'False
  23.    ScaleHeight     =   4080
  24.    ScaleWidth      =   8445
  25.    Top             =   3720
  26.    Width           =   8565
  27.    Begin VB.Frame Frame6 
  28.       Caption         =   "Knob Tick"
  29.       BeginProperty Font 
  30.          name            =   "MS Sans Serif"
  31.          charset         =   0
  32.          weight          =   700
  33.          size            =   8.25
  34.          underline       =   0   'False
  35.          italic          =   0   'False
  36.          strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   2055
  39.       Left            =   6030
  40.       TabIndex        =   22
  41.       Top             =   60
  42.       Width           =   2355
  43.       Begin VB.CommandButton CmdTickCaptionColor 
  44.          Appearance      =   0  'Flat
  45.          BackColor       =   &H80000005&
  46.          Caption         =   "Knob Tick Caption Color"
  47.          BeginProperty Font 
  48.             name            =   "MS Sans Serif"
  49.             charset         =   0
  50.             weight          =   400
  51.             size            =   8.25
  52.             underline       =   0   'False
  53.             italic          =   0   'False
  54.             strikethrough   =   0   'False
  55.          EndProperty
  56.          Height          =   315
  57.          Left            =   120
  58.          TabIndex        =   0
  59.          Top             =   1560
  60.          Width           =   2115
  61.       End
  62.       Begin VB.HScrollBar HScrollTickWidth 
  63.          Height          =   255
  64.          LargeChange     =   5
  65.          Left            =   660
  66.          Max             =   10
  67.          TabIndex        =   1
  68.          Top             =   240
  69.          Value           =   2
  70.          Width           =   1575
  71.       End
  72.       Begin VB.CommandButton CmdTickColor 
  73.          Appearance      =   0  'Flat
  74.          BackColor       =   &H80000005&
  75.          Caption         =   "Knob Tick Color"
  76.          BeginProperty Font 
  77.             name            =   "MS Sans Serif"
  78.             charset         =   0
  79.             weight          =   400
  80.             size            =   8.25
  81.             underline       =   0   'False
  82.             italic          =   0   'False
  83.             strikethrough   =   0   'False
  84.          EndProperty
  85.          Height          =   315
  86.          Left            =   120
  87.          TabIndex        =   2
  88.          Top             =   1200
  89.          Width           =   2115
  90.       End
  91.       Begin VB.HScrollBar HScrollTickLength 
  92.          Height          =   255
  93.          LargeChange     =   5
  94.          Left            =   660
  95.          Max             =   20
  96.          TabIndex        =   24
  97.          Top             =   540
  98.          Value           =   8
  99.          Width           =   1575
  100.       End
  101.       Begin VB.HScrollBar HScrollTickGap 
  102.          Height          =   255
  103.          LargeChange     =   5
  104.          Left            =   660
  105.          Max             =   10
  106.          Min             =   1
  107.          TabIndex        =   23
  108.          Top             =   840
  109.          Value           =   2
  110.          Width           =   1575
  111.       End
  112.       Begin VB.Label Label1 
  113.          Caption         =   "Width"
  114.          BeginProperty Font 
  115.             name            =   "MS Sans Serif"
  116.             charset         =   0
  117.             weight          =   400
  118.             size            =   8.25
  119.             underline       =   0   'False
  120.             italic          =   0   'False
  121.             strikethrough   =   0   'False
  122.          EndProperty
  123.          Height          =   255
  124.          Left            =   120
  125.          TabIndex        =   3
  126.          Top             =   240
  127.          Width           =   495
  128.       End
  129.       Begin VB.Label Label2 
  130.          Caption         =   "Length"
  131.          BeginProperty Font 
  132.             name            =   "MS Sans Serif"
  133.             charset         =   0
  134.             weight          =   400
  135.             size            =   8.25
  136.             underline       =   0   'False
  137.             italic          =   0   'False
  138.             strikethrough   =   0   'False
  139.          EndProperty
  140.          Height          =   255
  141.          Left            =   120
  142.          TabIndex        =   16
  143.          Top             =   540
  144.          Width           =   495
  145.       End
  146.       Begin VB.Label Label4 
  147.          Caption         =   "Gap"
  148.          BeginProperty Font 
  149.             name            =   "MS Sans Serif"
  150.             charset         =   0
  151.             weight          =   400
  152.             size            =   8.25
  153.             underline       =   0   'False
  154.             italic          =   0   'False
  155.             strikethrough   =   0   'False
  156.          EndProperty
  157.          Height          =   255
  158.          Left            =   120
  159.          TabIndex        =   17
  160.          Top             =   840
  161.          Width           =   495
  162.       End
  163.    End
  164.    Begin VB.Frame Frame5 
  165.       Caption         =   "Knob Bevel"
  166.       BeginProperty Font 
  167.          name            =   "MS Sans Serif"
  168.          charset         =   0
  169.          weight          =   700
  170.          size            =   8.25
  171.          underline       =   0   'False
  172.          italic          =   0   'False
  173.          strikethrough   =   0   'False
  174.       EndProperty
  175.       Height          =   675
  176.       Left            =   6030
  177.       TabIndex        =   14
  178.       Top             =   2490
  179.       Width           =   2355
  180.       Begin VB.HScrollBar HScrollBevelWidth 
  181.          Height          =   255
  182.          LargeChange     =   5
  183.          Left            =   120
  184.          Max             =   10
  185.          TabIndex        =   15
  186.          Top             =   300
  187.          Value           =   2
  188.          Width           =   2115
  189.       End
  190.    End
  191.    Begin VB.Frame Frame4 
  192.       Caption         =   "MIDI CoolTools Knob"
  193.       BeginProperty Font 
  194.          name            =   "MS Sans Serif"
  195.          charset         =   0
  196.          weight          =   700
  197.          size            =   8.25
  198.          underline       =   0   'False
  199.          italic          =   0   'False
  200.          strikethrough   =   0   'False
  201.       EndProperty
  202.       Height          =   3135
  203.       Left            =   2520
  204.       TabIndex        =   13
  205.       Top             =   60
  206.       Width           =   3435
  207.       Begin KnobLib.Knob Knob1 
  208.          Height          =   2775
  209.          Left            =   120
  210.          TabIndex        =   27
  211.          Top             =   240
  212.          Width           =   3255
  213.          _Version        =   65537
  214.          _ExtentX        =   5741
  215.          _ExtentY        =   4895
  216.          _StockProps     =   69
  217.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  218.             name            =   "MS Sans Serif"
  219.             charset         =   0
  220.             weight          =   700
  221.             size            =   8.25
  222.             underline       =   0   'False
  223.             italic          =   0   'False
  224.             strikethrough   =   0   'False
  225.          EndProperty
  226.          BevelWidth      =   2
  227.          BorderWidth     =   5
  228.          Indicator       =   0
  229.          IndicatorColor  =   255
  230.          IndicatorWidth  =   1
  231.          KnobColor       =   -2147483633
  232.          KnobStyle       =   1
  233.          Radius          =   285
  234.          TickCaptionColor=   0
  235.          TickColor       =   0
  236.          TickCount       =   3
  237.          TickGap         =   2
  238.          TickLength      =   8
  239.          TickWidth       =   1
  240.          Value           =   0
  241.          Max             =   100
  242.          Min             =   0
  243.          TickCaption     =   ""
  244.       End
  245.    End
  246.    Begin VB.Frame Frame3 
  247.       Caption         =   "Knob Style"
  248.       BeginProperty Font 
  249.          name            =   "MS Sans Serif"
  250.          charset         =   0
  251.          weight          =   700
  252.          size            =   8.25
  253.          underline       =   0   'False
  254.          italic          =   0   'False
  255.          strikethrough   =   0   'False
  256.       EndProperty
  257.       Height          =   1635
  258.       Left            =   60
  259.       TabIndex        =   10
  260.       Top             =   60
  261.       Width           =   2385
  262.       Begin VB.OptionButton OptionKnobStyle 
  263.          Caption         =   "Textured"
  264.          BeginProperty Font 
  265.             name            =   "MS Sans Serif"
  266.             charset         =   0
  267.             weight          =   400
  268.             size            =   8.25
  269.             underline       =   0   'False
  270.             italic          =   0   'False
  271.             strikethrough   =   0   'False
  272.          EndProperty
  273.          Height          =   195
  274.          Index           =   3
  275.          Left            =   1140
  276.          TabIndex        =   18
  277.          Top             =   540
  278.          Width           =   1000
  279.       End
  280.       Begin VB.OptionButton OptionKnobStyle 
  281.          Caption         =   "Lowered"
  282.          BeginProperty Font 
  283.             name            =   "MS Sans Serif"
  284.             charset         =   0
  285.             weight          =   400
  286.             size            =   8.25
  287.             underline       =   0   'False
  288.             italic          =   0   'False
  289.             strikethrough   =   0   'False
  290.          EndProperty
  291.          Height          =   195
  292.          Index           =   2
  293.          Left            =   150
  294.          TabIndex        =   19
  295.          Top             =   540
  296.          Width           =   915
  297.       End
  298.       Begin VB.OptionButton OptionKnobStyle 
  299.          Caption         =   "Raised"
  300.          BeginProperty Font 
  301.             name            =   "MS Sans Serif"
  302.             charset         =   0
  303.             weight          =   400
  304.             size            =   8.25
  305.             underline       =   0   'False
  306.             italic          =   0   'False
  307.             strikethrough   =   0   'False
  308.          EndProperty
  309.          Height          =   195
  310.          Index           =   1
  311.          Left            =   1140
  312.          TabIndex        =   20
  313.          Top             =   300
  314.          Value           =   -1  'True
  315.          Width           =   915
  316.       End
  317.       Begin VB.OptionButton OptionKnobStyle 
  318.          Caption         =   "Circle"
  319.          BeginProperty Font 
  320.             name            =   "MS Sans Serif"
  321.             charset         =   0
  322.             weight          =   400
  323.             size            =   8.25
  324.             underline       =   0   'False
  325.             italic          =   0   'False
  326.             strikethrough   =   0   'False
  327.          EndProperty
  328.          Height          =   195
  329.          Index           =   0
  330.          Left            =   150
  331.          TabIndex        =   21
  332.          Top             =   300
  333.          Width           =   915
  334.       End
  335.       Begin VB.CommandButton CmdKnobColor 
  336.          Appearance      =   0  'Flat
  337.          BackColor       =   &H80000005&
  338.          Caption         =   "Knob Color"
  339.          BeginProperty Font 
  340.             name            =   "MS Sans Serif"
  341.             charset         =   0
  342.             weight          =   400
  343.             size            =   8.25
  344.             underline       =   0   'False
  345.             italic          =   0   'False
  346.             strikethrough   =   0   'False
  347.          EndProperty
  348.          Height          =   315
  349.          Left            =   150
  350.          TabIndex        =   12
  351.          Top             =   810
  352.          Width           =   2115
  353.       End
  354.       Begin VB.CommandButton CmdKnobBckGrdColor 
  355.          Appearance      =   0  'Flat
  356.          BackColor       =   &H80000005&
  357.          Caption         =   "Knob Back Ground Color"
  358.          BeginProperty Font 
  359.             name            =   "MS Sans Serif"
  360.             charset         =   0
  361.             weight          =   400
  362.             size            =   8.25
  363.             underline       =   0   'False
  364.             italic          =   0   'False
  365.             strikethrough   =   0   'False
  366.          EndProperty
  367.          Height          =   315
  368.          Left            =   150
  369.          TabIndex        =   11
  370.          Top             =   1170
  371.          Width           =   2115
  372.       End
  373.    End
  374.    Begin VB.Frame Frame2 
  375.       Caption         =   "Knob Indicator"
  376.       BeginProperty Font 
  377.          name            =   "MS Sans Serif"
  378.          charset         =   0
  379.          weight          =   700
  380.          size            =   8.25
  381.          underline       =   0   'False
  382.          italic          =   0   'False
  383.          strikethrough   =   0   'False
  384.       EndProperty
  385.       Height          =   1455
  386.       Left            =   60
  387.       TabIndex        =   6
  388.       Top             =   1740
  389.       Width           =   2385
  390.       Begin VB.OptionButton OptionIndicator 
  391.          Caption         =   "Line"
  392.          BeginProperty Font 
  393.             name            =   "MS Sans Serif"
  394.             charset         =   0
  395.             weight          =   400
  396.             size            =   8.25
  397.             underline       =   0   'False
  398.             italic          =   0   'False
  399.             strikethrough   =   0   'False
  400.          EndProperty
  401.          Height          =   225
  402.          Index           =   1
  403.          Left            =   1320
  404.          TabIndex        =   26
  405.          Top             =   300
  406.          Width           =   825
  407.       End
  408.       Begin VB.OptionButton OptionIndicator 
  409.          Caption         =   "Spot"
  410.          BeginProperty Font 
  411.             name            =   "MS Sans Serif"
  412.             charset         =   0
  413.             weight          =   400
  414.             size            =   8.25
  415.             underline       =   0   'False
  416.             italic          =   0   'False
  417.             strikethrough   =   0   'False
  418.          EndProperty
  419.          Height          =   225
  420.          Index           =   0
  421.          Left            =   180
  422.          TabIndex        =   25
  423.          Top             =   300
  424.          Value           =   -1  'True
  425.          Width           =   825
  426.       End
  427.       Begin VB.CommandButton CmdKnobIndicatorColor 
  428.          Appearance      =   0  'Flat
  429.          BackColor       =   &H80000005&
  430.          Caption         =   "Knob Indicator Color"
  431.          BeginProperty Font 
  432.             name            =   "MS Sans Serif"
  433.             charset         =   0
  434.             weight          =   400
  435.             size            =   8.25
  436.             underline       =   0   'False
  437.             italic          =   0   'False
  438.             strikethrough   =   0   'False
  439.          EndProperty
  440.          Height          =   315
  441.          Left            =   90
  442.          TabIndex        =   8
  443.          Top             =   1020
  444.          Width           =   2115
  445.       End
  446.       Begin VB.HScrollBar HScrollIndicatorWidth 
  447.          Enabled         =   0   'False
  448.          Height          =   255
  449.          LargeChange     =   2
  450.          Left            =   630
  451.          Max             =   7
  452.          Min             =   1
  453.          TabIndex        =   7
  454.          Top             =   660
  455.          Value           =   1
  456.          Width           =   1575
  457.       End
  458.       Begin VB.Label Label3 
  459.          Caption         =   "Width"
  460.          BeginProperty Font 
  461.             name            =   "MS Sans Serif"
  462.             charset         =   0
  463.             weight          =   400
  464.             size            =   8.25
  465.             underline       =   0   'False
  466.             italic          =   0   'False
  467.             strikethrough   =   0   'False
  468.          EndProperty
  469.          Height          =   255
  470.          Left            =   90
  471.          TabIndex        =   9
  472.          Top             =   660
  473.          Width           =   495
  474.       End
  475.    End
  476.    Begin VB.Frame Frame1 
  477.       Caption         =   "Knob Radius"
  478.       BeginProperty Font 
  479.          name            =   "MS Sans Serif"
  480.          charset         =   0
  481.          weight          =   700
  482.          size            =   8.25
  483.          underline       =   0   'False
  484.          italic          =   0   'False
  485.          strikethrough   =   0   'False
  486.       EndProperty
  487.       Height          =   675
  488.       Left            =   60
  489.       TabIndex        =   4
  490.       Top             =   3270
  491.       Width           =   8355
  492.       Begin VB.HScrollBar HScrollRadius 
  493.          Height          =   255
  494.          LargeChange     =   50
  495.          Left            =   90
  496.          Max             =   950
  497.          Min             =   140
  498.          SmallChange     =   10
  499.          TabIndex        =   5
  500.          Top             =   300
  501.          Value           =   300
  502.          Width           =   8175
  503.       End
  504.    End
  505.    Begin MSComDlg.CommonDialog CMDialog1 
  506.       Left            =   240
  507.       Top             =   4230
  508.       _Version        =   65536
  509.       _ExtentX        =   847
  510.       _ExtentY        =   847
  511.       _StockProps     =   0
  512.    End
  513. Attribute VB_Name = "FormKnob"
  514. Attribute VB_Creatable = False
  515. Attribute VB_Exposed = False
  516. Private Sub CmdKnobBckGrdColor_Click()
  517.     '
  518.     ' Load the control with the current (or last selected) shapes
  519.     ' FillColor
  520.     '
  521.     CMDialog1.Color = KNOB1.BackColor
  522.     '
  523.     ' Execute the color select dialog
  524.     '
  525.     CMDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
  526.     CMDialog1.Action = DLG_COLOR
  527.     '
  528.     ' Assign the selected color to the shape's color properties
  529.     '
  530.     KNOB1.BackColor = CMDialog1.Color
  531. End Sub
  532. Private Sub CmdKnobColor_Click()
  533.     '
  534.     ' Load the control with the current (or last selected) shapes
  535.     ' FillColor
  536.     '
  537.     CMDialog1.Color = KNOB1.KnobColor
  538.     '
  539.     ' Execute the color select dialog
  540.     '
  541.     CMDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
  542.     CMDialog1.Action = DLG_COLOR
  543.     '
  544.     ' Assign the selected color to the shape's color properties
  545.     '
  546.     KNOB1.KnobColor = CMDialog1.Color
  547. End Sub
  548. Private Sub CmdKnobIndicatorColor_Click()
  549.     '
  550.     ' Load the control with the current (or last selected) shapes
  551.     ' FillColor
  552.     '
  553.     CMDialog1.Color = KNOB1.IndicatorColor
  554.     '
  555.     ' Execute the color select dialog
  556.     '
  557.     CMDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
  558.     CMDialog1.Action = DLG_COLOR
  559.     '
  560.     ' Assign the selected color to the shape's color properties
  561.     '
  562.     KNOB1.IndicatorColor = CMDialog1.Color
  563. End Sub
  564. Private Sub CmdTickCaptionColor_Click()
  565.     '
  566.     ' Load the control with the current (or last selected) shapes
  567.     ' FillColor
  568.     '
  569.     CMDialog1.Color = KNOB1.TickCaptionColor
  570.     '
  571.     ' Execute the color select dialog
  572.     '
  573.     CMDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
  574.     CMDialog1.Action = DLG_COLOR
  575.     '
  576.     ' Assign the selected color to the shape's color properties
  577.     '
  578.     KNOB1.TickCaptionColor = CMDialog1.Color
  579. End Sub
  580. Private Sub CmdTickColor_Click()
  581.     '
  582.     ' Load the control with the current (or last selected) shapes
  583.     ' FillColor
  584.     '
  585.     CMDialog1.Color = KNOB1.TickColor
  586.     '
  587.     ' Execute the color select dialog
  588.     '
  589.     CMDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
  590.     CMDialog1.Action = DLG_COLOR
  591.     '
  592.     ' Assign the selected color to the shape's color properties
  593.     '
  594.     KNOB1.TickColor = CMDialog1.Color
  595. End Sub
  596. Private Sub Form_Load()
  597.     ' Center the form on the screen
  598.     Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  599.     KNOB1.TickCaptions = "Left" & Chr(10) & "Center" & Chr(10) & "Right"
  600. End Sub
  601. Private Sub HScrollBevelWidth_Change()
  602.     KNOB1.BevelWidth = HScrollBevelWidth.Value
  603. End Sub
  604. Private Sub HScrollBevelWidth_Scroll()
  605.     KNOB1.BevelWidth = HScrollBevelWidth.Value
  606. End Sub
  607. Private Sub HScrollIndicatorWidth_Change()
  608.     KNOB1.IndicatorWidth = HScrollIndicatorWidth.Value
  609. End Sub
  610. Private Sub HScrollIndicatorWidth_Scroll()
  611.     KNOB1.IndicatorWidth = HScrollIndicatorWidth.Value
  612. End Sub
  613. Private Sub HScrollRadius_Change()
  614.     KNOB1.Radius = HScrollRadius.Value
  615. End Sub
  616. Private Sub HScrollRadius_Scroll()
  617.     KNOB1.Radius = HScrollRadius.Value
  618. End Sub
  619. Private Sub HScrollTickGap_Change()
  620.     KNOB1.TickGap = HScrollTickGap.Value
  621. End Sub
  622. Private Sub HScrollTickGap_Scroll()
  623.     KNOB1.TickGap = HScrollTickGap.Value
  624. End Sub
  625. Private Sub HScrollTickLength_Change()
  626.     KNOB1.TickLength = HScrollTickLength.Value
  627. End Sub
  628. Private Sub HScrollTickLength_Scroll()
  629.     KNOB1.TickLength = HScrollTickLength.Value
  630. End Sub
  631. Private Sub HScrollTickWidth_Change()
  632.     KNOB1.TickWidth = HScrollTickWidth.Value
  633. End Sub
  634. Private Sub HScrollTickWidth_Scroll()
  635.     KNOB1.TickWidth = HScrollTickWidth.Value
  636. End Sub
  637. Private Sub OptionIndicator_Click(index As Integer)
  638.     KNOB1.Indicator = index
  639.     If index = 0 Then HScrollIndicatorWidth.Enabled = False Else HScrollIndicatorWidth.Enabled = True
  640. End Sub
  641. Private Sub OptionKnobStyle_Click(index As Integer)
  642.     KNOB1.KnobStyle = index
  643.     If index = 3 Then HScrollBevelWidth.Enabled = False Else HScrollBevelWidth.Enabled = True
  644. End Sub
  645.